#ifndef FSM_H
#define FSM_H
//-------------------------------------------------------------
#include <map>
#include <utility>
#include "State.h"
#include "Event.h"
//-------------------------------------------------------------
using namespace std;
//-------------------------------------------------------------
class FSM
{
public:
	FSM();
	~FSM();

	void registerTransition(State* kOriginState, Event* kEvent, State* kDestState);
	void doEvent(Event* kEvent);
	void update();

private:
	typedef pair<State*, Event*> StateEventPair;
	typedef pair<StateEventPair, State*> TransitionPair;
	typedef map<StateEventPair, State*> TransitionMap;
	typedef TransitionMap::iterator itTransitionMap;
	TransitionMap m_kTransitions;

	State* m_kCurrentState;
};
//-------------------------------------------------------------
#endif //FSM_H
//-------------------------------------------------------------
